package com.paw.file.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.tg.paw.common.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.util.Date;

/**
 * <p>
 * 文件信息
 * </p>
 *
 * @author Rubble
 * @since 2020-04-24
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("file_info")
@ApiModel(value="FileInfo对象", description="文件信息")
public class FileInfo extends BaseEntity {

    private static final long serialVersionUID=1L;

    @ApiModelProperty(value = "主键")
    @TableId(value = "id", type = IdType.AUTO)
    @JsonSerialize(using= ToStringSerializer.class)
    @JSONField(serializeUsing = com.alibaba.fastjson.serializer.ToStringSerializer.class)
    private Long id;

    @ApiModelProperty(value = "md5")
    @TableField("md5")
    private String md5;

    @ApiModelProperty(value = "原始文件名")
    @TableField("src_file_name")
    private String srcFileName;

    @ApiModelProperty(value = "是否图片 0否 1是")
    @TableField("img_status")
    private Integer imgStatus;

    @ApiModelProperty(value = "上传文件类型")
    @TableField("content_type")
    private String contentType;

    @ApiModelProperty(value = "文件大小")
    @TableField("file_size")
    private Integer fileSize;

    @ApiModelProperty(value = "路径")
    @TableField("path")
    private String path;

    @ApiModelProperty(value = "oss访问路径")
    @TableField("url")
    private String url;

    @ApiModelProperty(value = "创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Date createTime;

    @ApiModelProperty(value = "创建者")
    @TableField(value = "creator", fill = FieldFill.INSERT)
    private String creator;


}
